package com.hsmpay.mobile.service.bank.impl;

import com.hsmpay.common.service.impl.BaseServiceSupport;
import com.hsmpay.common.util.ThreeMaoBankUtil;
import com.hsmpay.mobile.dao.bank.BankDao;
import com.hsmpay.mobile.pojo.bank.Bank;
import com.hsmpay.mobile.service.bank.BankService;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

/**
 * 合作银行业务接口实现类 bankService
 * 对应数据层 bankDao
 *
 * @author 颜铃璋
 * @date 2013-1-5
 */
@Repository("bankService")
public class BankServiceImpl extends BaseServiceSupport<Bank, Long> implements BankService<Bank, Long> {
    @Resource(name = "bankDao")
    private BankDao<Bank, Long> bankDao;

    /**
     * 根据银行名称 查出银行对象
     *
     * @param bankName
     * @return
     * @throws Exception
     */
    public Bank searchBankByName(String bankName) throws Exception {
        return bankDao.searchBankByName(bankName);
    }

    /**
     * 查询所有可清算的银行列表
     * 支持三毛 万三
     *
     * @param bank
     * @return
     * @throws Exception
     */
    public List<Bank> searchCleanBankList() throws Exception {
        Bank bank = new Bank();
        bank.setOtherParam(" ID IN(" + ThreeMaoBankUtil.threeMaoBankIds + ") ");
        return searchEntityList(bank);
    }

    //---------------------set get start--------------------
    //---------------------set get end----------------------
}
